<template>
  <div class="xy-header-info info-item" :class="{'bold':bold, 'width100' : alignRight || w100}">
    <span :class="{'alignRight':alignRight}" v-show="infoKey">{{infoKey}} {{risk ? ':' : ''}}</span>
    <span v-show="infoValue">{{infoValue}}</span>
    <slot></slot>
  </div>
</template>

<script>
export default {
  name: "HeaderInfo",
  props: {
    infoKey: {
      type: String
    },
    infoValue: {
      type: [String, Number],
      default: "--"
    },
    bold: {
      type: Boolean,
      default: false
    },
    alignRight: {
      type: Boolean,
      default: false
    },
    risk: {
      type: Boolean,
      default: true
    },
    w100: {
      type: Boolean,
      default: false
    }
  },
  data() {
    return {};
  },
  watch: {},
  computed: {},
  methods: {}
};
</script>

<style lang="scss" scoped>
@import "../assets/scss/variable.scss";
.info-item {
  display: inline-block;
  width: 45%;
  margin-top: 10px;
  span {
    display: inline-block;
    position: relative;
    vertical-align: top;
    // height: 34px;
    line-height: 34px;
    word-break: break-all;
    i {
      position: absolute;
      display: block;
      width: 45px !important;
      height: 20px !important;
      line-height: 20px;
      text-align: center;
      top: -2px;
      left: 170px;
      color: #fff;
      font-style: normal;
    }
  }
  .el-input-group--append {
    width: 320px;
  }
}
.bold {
  font-weight: bolder;
  font-size: 18px;
}
.alignRight {
  text-align: right;
  width: 15%;
  padding-right: 10px;
}
.width100 {
  width: 100%;
}
.info-textarea {
  width: 60%;
  display: inline-block;
  .el-textarea__inner{
    width: 360px;
  }
}
</style>
